package com.springinaction.knights;

public class TestKnight implements Knight {

    private Quest quest;

    private Minstrel minstrel;

    public TestKnight(Quest quest, Minstrel minstrel) {
        this.quest = quest;
        this.minstrel = minstrel;
    }

    public TestKnight(Quest quest) {
        this.quest = quest;
    }

    @Override
    public void embarkOnQuest() {
        //进行切面的插入
        minstrel.singBeforeQuest();
        quest.embark();
        minstrel.singAfterQuest();
    }
}
